<template>
	<view class="content">
		<button type="default" @click="go">点击</button>
		<image src="https://file-1.book118.com/sr1/M00/12/27/wKh2Al3XdA2IRGDHAAAM3R3tsioAAg8EADXcUQAAAz1347.png" mode=""></image>
	</view>
</template>

<script>
	import { demo } from '@/api/demo.js';
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		// #ifdef VUE2
		onLoad() {
			demo().then(res=>{
				console.log('VUE2',res)
			})
		},
		// #endif
		// #ifdef VUE3
		setup(){
			// uni.request({
			// 	url: 'https://api.book118.com/applet/index/getRecommendDocs',
			// 	success: data => {
			// 		console.log(data)
			// 	},
			// 	fail: (data, code) => {
			// 		console.log('fail' + JSON.stringify(data));
			// 	}
			// });
			// demo().then(res=>{
			// 	console.log(res)
			// })
			const go = ()=>{
				// uniWebView.navigateTo({
				// 	url:'/pages/test1/test1'
				// })
				uni.navigateTo({
					url:'/pages/demo/demo?id=哈哈哈'
				})
			}
			return {
				go
			}
		}
		// #endif
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
